home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Your Choice 3
/
Your Choice Software Collection 3.iso
/
prgmming
/
os2
/
control.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1994-04-07
|
721b
|
37 lines
#include "control.h"
// basic functions shared by all controls
Control::Control(HWND hParent, ULONG ulId)
{
fCreated=FALSE;
if(ulId > 0)
hWnd = WinWindowFromID(hParent,ulId);
}
BOOL Control::Hide()
{
return (BOOL) WinShowWindow(hWnd, FALSE);
}
BOOL Control::Show()
{
return (BOOL) WinShowWindow(hWnd, TRUE);
}
Control::~Control()
{
// destroy window if we created it. All subclasses are expected
// to have an option to create the window.
if(fCreated) WinDestroyWindow(hWnd);
}
VOID Control::SetPos(SHORT xp, SHORT yp, SHORT width, SHORT height)
{
WinSetWindowPos(
hWnd,
0,
xp, yp,
width, height,
SWP_MOVE | SWP_SIZE);
}